<template>
  <div>这是detail页面</div>
  <button @click="fn">btn</button>
</template>

<script setup>
// this.$route.params.id

import { useRoute } from "vue-router";

// useRoute和useRouter都需要在setup的顶层调用
const route = useRoute();
const fn = () => {
  console.log(route.params.id);
};
</script>
